{extend name="../../base/view/layout" /}
{block name="my_body"}
<div class="widgetbox box-inverse">
    <div class="widgetcontent wc1">

        <form id="form1" class="stdform" enctype="multipart/form-data" method="post" action="<?php echo url('news/Article/edit');?>">

            <div class="tabbable">
                <ul class="nav nav-tabs buttons-icons">
                    <li class="active"><a data-toggle="tab" href="#shop_info">基本信息</a></li>
                    <li><a data-toggle="tab" href="#shop_content">文章描述</a></li>
                </ul>
                <div class="tab-content">
                    <div id="shop_info" class="tab-pane active">

                        <div class="par control-group">
                            <label class="control-label" for="cat_id">文章分类</label>
                            <span class="field">
                            <select name="cat_id" class="uniformselect" id="cat_id">
                            	<option value="">--请选择--</option>
                                <?php foreach($catData as $v):?>
                                <option value="<?php echo $v['id'];?>" <?php if($data['cat_id'] == $v['id']) echo 'selected';?> ><?php echo str_repeat('-',$v['level']),$v['name'];?></option>
                                <?php endforeach;?>
                            </select>
                            </span>
                        </div>

                        <div class="par control-group">
                            <label class="control-label" for="title">文章标题</label>
                            <div class="controls"><input type="text" name="title" id="title" class="input-xlarge" value="<?php echo $data['title'];?>" /></div>
                        </div>
                        <input type="hidden" name="id" value="<?php echo $data['id'];?>" />

                        <div class="par control-group">
                            <label class="control-label" for="sort_num">排序</label>
                            <div class="controls"><input type="text" name="sort_num" id="sort_num" class="input-xlarge" value="<?php echo $data['sort_num'];?>" /></div>
                        </div>


                        <div class="par control-group">
                            <label class="control-label" for="intro">文章简介</label>
                            <div class="controls">
                                <textarea name="intro" id="intro" rows="5"><?php echo $data['intro'];?></textarea>
                            </div>
                        </div>

                        <div class="par control-group">
                            <label class="control-label" for="keywords">文章关键字</label>
                            <div class="controls">
                                <textarea name="keywords" id="keywords"><?php echo $data['keywords'];?></textarea>&ensp;*逗号分割
                            </div>
                        </div>


                        <div class="control-group par">
                            <label class="control-label" for="logo">文章主图</label>
                            <div class="controls"><input type="file" name="logo" id="logo" class="input-xlarge"  /></div>
                        </div>

                        <?php if(!empty($data['sm_logo'])):?>
                        <div class="control-group par">
                            <label class="control-label" for="logo"></label>
                            <div class="controls"><?php showImage($data['sm_logo']);?></div>
                        </div>
                        <?php endif;?>

                    </div><!--tab-pane-->
                    <div id="shop_content" class="tab-pane">

                        <textarea id="goods_desc" name="content" ><?php echo $data['content'];?></textarea>

                    </div>

                </div><!--tabcontent-->
            </div><!--tabbable-->


            <p class="stdformbutton">
                <input type="submit" class="btn btn-primary" />
            </p>
        </form>
    </div><!--widgetcontent-->
</div><!--widget-->
{/block}

{block name="my_js"}
<script>
    var $ = jQuery.noConflict();
</script>
<!-- 配置文件 -->
<script type="text/javascript" src="/qiniu_ueditor_1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/qiniu_ueditor_1.4.3/ueditor.all.js"></script>
<script>
    UE.getEditor('goods_desc', {
        initialFrameWidth : "100%",
        initialFrameHeight : "500"
    });

</script>
{/block}